#pragma once

VOID multiboard_finalize(JSContext *cx, JSObject *obj);
INT multiboard_getProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp);
INT multiboard_setProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp);


#define DEFFNC(f) INT f (JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval);

DEFFNC(multiboard_remove)
DEFFNC(multiboard_setItemValue)
DEFFNC(multiboard_setItemWidth)
DEFFNC(multiboard_setItemIcon)

#undef DEFFNC

/**********************************************************

					Classes/Objects/Methods

 **********************************************************/

static JSClass multiboard_class = {
    "multiboard",	JSCLASS_HAS_PRIVATE,
    JS_PropertyStub, JS_PropertyStub, multiboard_getProperty, multiboard_setProperty,
    JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, multiboard_finalize,
    NULL, NULL, 
};

enum multiboard_tinyid {
	MULTIBOARD_TITLE,
	MULTIBOARD_TITLECOLOR,
	MULTIBOARD_ROWS,
	MULTIBOARD_COLUMNS,
	MULTIBOARD_DISPLAYED,
	MULTIBOARD_MINIMIZED,
};

static JSPropertySpec multiboard_props[] = {
	{"title",			MULTIBOARD_TITLE,		JSPROP_ENUMERATE},
	{"titlecolor",		MULTIBOARD_TITLECOLOR,	JSPROP_ENUMERATE},
	{"rows",			MULTIBOARD_ROWS,		JSPROP_ENUMERATE},
	{"columns",			MULTIBOARD_COLUMNS,		JSPROP_ENUMERATE},
	{"displayed",		MULTIBOARD_DISPLAYED,	JSPROP_ENUMERATE},
	{"minimized",		MULTIBOARD_MINIMIZED,	JSPROP_ENUMERATE},
	{0},
};

static JSFunctionSpec multiboard_methods[] = {
	{"remove",			multiboard_remove,			0},
	{"setItemValue",	multiboard_setItemValue,	3},
	{"setItemWidth",	multiboard_setItemWidth,	3},
	{"setItemIcon",		multiboard_setItemIcon,		3},
};

struct myBoard
{
	DWORD _dwPrivateType;
	cMultiboard* pMultiboard;
};